#ifndef BUTTON_H
#define BUTTON_H

#include <QWidget>
#include <QToolButton>
class QMouseEvent;
class QPaintEvent;
class QEvent;
class QPixmap;
namespace Ui {
class Button;
}

class Button : public QToolButton
{
    Q_OBJECT

public:
    //只能显式引用 explicit关键字
    explicit Button(QString strw,QString struri,QString tips,QPixmap p,QToolButton *parent = 0);
    ~Button();
    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void enterEvent(QEvent *e);//鼠标进入事件
     void leaveEvent(QEvent *e);//离开
    void paintEvent(QPaintEvent *event);

public:
    QString text;
    QString bg_uri;
    QString str_tips;
    QPixmap p_wh;
    bool is_release;
};

#endif // BUTTON_H
